﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WP8_Client.Model
{
    public class Session : INotifyPropertyChanged
    {   
        public Int32 ID { get; set; }
        public ObservableCollection<User> UserList { get; private set; }        

        public Session()
        {
            this.UserList = new ObservableCollection<User>();
            this.UserList.CollectionChanged += UserList_CollectionChanged;
        }

        void UserList_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
        {
            RaisePropertyChanged("UserList");
        }

        #region INotifyPropertyChanged
        public event PropertyChangedEventHandler PropertyChanged;

        void RaisePropertyChanged(string pPropertyName)
        {
            if (this.PropertyChanged != null)
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(pPropertyName));
            }
        }
        #endregion
    }
}
